{extend name="public:layout" /}
{block name="title"}
{$userInfo.member_truename}的名片
{/block}
{block name="head"}

<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
    wx.config({$options | json_encode});
    wx.ready(function(){
        var data={
            title: '{$userInfo.member_truename}的名片', // 分享标题
            desc: '这是我的名片请惠存', // 分享描述
            link: '{:get_current_url()}', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: '{:empty($userInfo["member_avatar"])?"":strstr("http",$userInfo["member_avatar"])?$userInfo["member_avatar"]:$Request.domain.$userInfo["member_avatar"]}', // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        };
        wx.onMenuShareTimeline(data);
        wx.onMenuShareAppMessage(data);
        wx.onMenuShareQQ(data);
        wx.onMenuShareWeibo(data);
        wx.onMenuShareQZone(data);

    });
</script>
{/block}
{block name="body"}
<div class="businesscard-box">
    <div class="card-head">
        <div class="bg" style="background-image:url(/public/home/bus/image/banner01.jpg)">
            <a href="userinfo.html" class="set">
                <span class="iconfont icon-setting"></span>
            </a>
        </div>
        <div class="head-info">
            <div class="headimg">
                <img src="{$userInfo.member_avatar|default='/public/home/bus/image/headimg.jpg'}" class="avatar" alt="">
            </div>
            <div class="username">
                {$userInfo.member_truename}
            </div>
            {notempty name='userInfo.company_id'}
                <div class="postinfo">
                    {$userInfo.member_duties}<span class="pipes">|</span>{$userInfo.company_name}
                </div>
                {eq name="userInfo.companyInfo.is_examine" value="1"}
                <div class="industry">
                    {$userInfo.companyInfo.company_name}<span class="pipes">|</span>{$userInfo.companyInfo.address_text}
                </div>
                {/eq}
            {/notempty}
            <div class="user-tags">
                {eq name='isLogin' value='0'}
                <span class="tag"><a href="{:url('Public/userLogin',['reback'=>get_current_url()])}">请先登陆</a></span>
                {else}
                {neq name="isLogin" value="$userInfo.member_id"}
                <span class="tag" onclick="setAttention()" id="attention">{eq name="$userInfo.is_attention" value="0"}关注用户{else}取消关注{/eq}</span>
                {/neq}
                {/eq}
                <!--<span class="tag certified"></span>-->
                <!--<span class="tag ibi"></span>-->
                <!--<span class="tag vip"></span>-->
            </div>
        </div>
    </div>
    <div class="card-cut"></div>
    <div class="card-info">
        <div class="row">
            <a href="tel:{$userInfo.member_mobile}" class="link"></a>
            <div class="icon">
                <span class="iconfont icon-iconfontdianhua"></span>
            </div>
            <div class="con">{$userInfo.member_tel}</div>
            <div class="right-arrow">
                <span class="iconfont icon-zuoyou"></span>
            </div>
        </div>
        {notempty name='userInfo.company_id'}
        {eq name="userInfo.companyInfo.is_examine" value="1"}
        <div class="row">
            <div class="icon">
                <span class="iconfont icon-xiazai18"></span>
            </div>
            <div class="con">{$userInfo.companyInfo.address_text}{$userInfo.companyInfo.company_address}</div>
        </div>
        {/eq}
        {/notempty}
    </div>
    {notempty name='userInfo.company_id'}
    {eq name="userInfo.companyInfo.is_examine" value="1"}
    <div class="card-cut"></div>
    <div class="company-info-box">
        <div class="company-name">
            {$userInfo.companyInfo.company_name}
        </div>
        <div class="info-desc">
            <a href="{:url('companyInfo',['company_id'=>$userInfo.companyInfo.company_id])}" class="link">
            <div class="thumb">
                <img src="{$userInfo.companyInfo.company_logo}" alt="">
            </div>
            <div class="info">
                <div class="row">
                    <span class="tit">所在区域</span>
                    <span class="text">{$userInfo.companyInfo.address_text}</span>
                </div>
                <div class="row">
                    <span class="tit">主营业务</span>
                    <span class="text">
                    {$userInfo.companyInfo.company_intro}
                </span>
                </div>
            </div>
            </a>
        </div>
    </div>
    {else}
    企业“{$userInfo.companyInfo.company_name}”尚未经过审核，不展示企业信息
    {/eq}
    {/notempty}
    <div class="card-cut"></div>
    <div class="circleinfo-list" id="list">
        {volist name="userInfo.theme_list" id="vo"}
        <div class="info-item">
            <div class="infobox" style="padding-left:0;">
                <div class="info-text">
                    <a href="{:url('Theme/info',['theme_id'=>$vo.theme_id])}">
                    {$vo.theme_name}
                    </a>
                </div>
                <div class="info-imgs">
                    {volist name="vo.theme_image" id="v"}
                    <img src="{$v}" alt="">
                    {/volist}
                </div>
                <div class="info-after">
                    <div class="date">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
                    <div class="source">来自 <a href="{:url('Theme/index',['circle_id'=>$vo.circle_id])}" class="link">{$vo.circle_name}</a></div>
                </div>
            </div>
        </div>
        {/volist}
            <p style="padding:10px;">
                <a href="{:url('Theme/index',['member_id'=>$userInfo.member_id])}" class="weui-btn weui-btn_default" style="font-size:12px;">查看更多>></a>
            </p>
    </div>
</div>
{/block}
{block name="js"}
<script src="/public/home/bus/lib/fastclick.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
    function setAttention() {
        var obj=$('#attention');
        $.post('/Circle/Member/memberAttention',{member_id:'{$userInfo.member_id}'},function (res) {
            layer.open({
                content:res.msg
                ,skin: 'msg'
                ,time: 2 //2秒后自动关闭
            });
            if (res.code){
                var text=obj.text();
                obj.text(text=="关注用户"?'取消关注':'关注用户')
            }
        })
    }
</script>
{/block}